package com.bestcem.xm.user.mq.receiver.biz;

import com.bestcem.xm.user.mq.message.organization.OrgCreateMessage;
import com.bestcem.xm.user.service.UserMessageReceiverService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.support.GenericMessage;
import org.springframework.stereotype.Component;

/**
 * @author SXS
 */
@Slf4j
@Component
public class ReceiverService {

    private final UserMessageReceiverService userMessageReceiverService;

    public ReceiverService(UserMessageReceiverService userMessageReceiverService) {
        this.userMessageReceiverService = userMessageReceiverService;
    }

    public void orgCreated(GenericMessage<OrgCreateMessage> msg) {
        userMessageReceiverService.orgCreated(msg.getPayload());
    }
}
